/**
 *  网页调用示例：params可为null
 * 
 *  @param params //var params = { multiple: 2, preview: false, maxCount: 4 };
 * 
 *  @method androidpicture.openCamera(params, suc, fail);//单独调用拍照
 *  @method androidpicture.takeSinglePic(params, suc, fail);//单选相册
 *  @method androidpicture.takePic(params, suc, fail);      //多选相册
 *  @method androidpicture.deleteCacheDir(null, suc, fail);
 *  @returns data //[{"compressPath":"/storage/emulated/0/Tencent/TIMfile_recv/Y%[7MA{V{V8L~0AO34W9{83.png","compressed":true,"duration":0,"height":0,"isChecked":false,"isCut":false,"mimeType":1,"num":1,"path":"/storage/emulated/0/Tencent/TIMfile_recv/Y%[7MA{V{V8L~0AO34W9{83.png","pictureType":"image/png","position":9,"width":0}]

 *  var suc = function(data) {//data  为json数组
 *  例如 data[0] 里面返回三种path
 *  1.media.getPath(); 为原图path
 *  2.media.getCutPath();为裁剪后path，需判断media.isCut();是否为true  注意：音视频除外
 *  3.media.getCompressPath();为压缩后path，需判断media.isCompressed();是否为true  注意：音视频除外
 *  如果裁剪并压缩了，以取压缩路径为准，因为是先裁剪后压缩的
 *              //成功
 *            console.log("androidpicture" + data[0].compressPath);
 *            console.log(JSON.stringify(data));
 *       };
 * 
 *  var fail = function(data) {
 *              //失败
 *         };
 * 目前params支持的可选参数如下
 * @param mimeType 全部.0、图片.1、视频.2、音频.3
 * @param maxCount 最大图片选择数量 int
 * @param minCount 最小选择数量 int
 * @param multiple 多选 or 单选 2 or 1
 * @param preview  是否可预览图片
 * @param camera   是否显示拍照按钮
 * @param crop     裁剪宽
 * @param compress 是否压缩
 * @param gif      是否显示gif图片
 * @param selected 是否传入已选图片
 * @param cropCompressQuality 裁剪压缩质量0-100 def 90
 * @param cropWH   裁剪宽高比，设置如果大于图片本身宽高则无效 int
 * 
 */
var exec = require('cordova/exec');

exports.takePic = function (arg0, success, error) {
    exec(success, error, 'androidpicture', 'takePic', [arg0]);
};
exports.takeSinglePic = function (arg0, success, error) {
    exec(success, error, 'androidpicture', 'takeSinglePic', [arg0]);
};

exports.openCamera = function (arg0, success, error) {
    exec(success, error, 'androidpicture', 'openCamera', [arg0]);
};


exports.deleteCacheDir = function (arg0, success, error) {
    exec(success, error, 'androidpicture', 'deleteCacheDir', [arg0]);
};